﻿using diary.POCO;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace diary
{
    /// <summary>
    /// Interaction logic for EventControl.xaml
    /// </summary>
    public partial class EventControl : UserControl
    {
        public EventControl()
        {
            InitializeComponent();
            this.DataContext = this;
            FirstColumn.Width = new GridLength(0);
        }

        private Event _event;
        public Event Event 
        {
            get
            {
                return _event;
            }
            set
            {
                _event = value;
                if (_event.Rank > 0)
                {
                    FirstColumn.Width = new GridLength(20);
                }
            }
        }
    }
}
